import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

public class Royal {

    public static Set<RoyalPair> tuples;

    public static String[] royalWords = {"royalty from london","british royalty","united kingdom dukes", "british dominions","house of windsor",
            "windsor castle", "royalty from berkshire", "english dukes", "kings and queens of the united kingdom",
            " queen ", " king ", " prince ", " princess ",  " duchess "};


    public static void main(String[] args) throws IOException {


        tuples = new HashSet<RoyalPair>();
        WebGraph webGraph = new WebGraph();
        Search.crawl(webGraph, "http://simple.wikipedia.org/wiki/Prince_William,_Duke_of_Cambridge", 50);

        File file = new File("royal.txt");
        // if file doesnt exists, then create it
        if (!file.exists()) {
            file.createNewFile();
        }
        FileWriter fw = new FileWriter(file.getAbsoluteFile());
        BufferedWriter bw = new BufferedWriter(fw);
        for (RoyalPair pair: tuples) {
            bw.write(pair.toString() + "\n");
        }

        bw.close();

    }
}
